package com.study.controller.HRcontroller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.study.model.pojo.HRpojo.InterviewTab;
import com.study.model.pojo.HRpojo.ResumeTab;
import com.study.service.HRservice.InterviewService;
import com.study.service.HRservice.ResumeService;

//解决跨域
@CrossOrigin
@RequestMapping("interview")
@RestController
public class InterviewController {

	@Autowired
	InterviewService interService;
	//简历表 （方便查出面试状态为预约的人员信息）
	@Autowired
	ResumeService reService;
	
	@RequestMapping("viewFindAll")
	/**
	 * 查询面试记录所有信息
	 * @return
	 */
	public List<InterviewTab> findAll(){
		
		List<InterviewTab> findAll = interService.findAll();
		System.out.println(findAll);
		return findAll;
	}
	
	@RequestMapping("viewFindByresid")
	/**
	 * 查询面试记录所有信息(面试状态为1的人员)
	 * @return
	 */
	public List<ResumeTab> findByResid(){
		//先查出状态为1的所有简历信息
		int a = 1;
		List<ResumeTab> findByResstate = reService.findByResstate(a);
		
//		for (ResumeTab resumeTab : findByResstate) {
//			System.out.println();
//		}
		
		
//		List<InterviewTab> findByResid = null;
//		//循环将其resid
//		for (ResumeTab resumeTab : findByResstate) {
//			System.out.println(resumeTab.getResid());
//			findByResid = interService.findByResid(resumeTab.getResid());
//		}
		return findByResstate;
	}
	
	
	
}

